package com.burst.reptile.modular.zp.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.burst.reptile.framework.web.controller.BaseController;
import com.burst.reptile.framework.web.result.Result;
import com.burst.reptile.modular.zp.service.IZpCommSupService;

import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 评论点赞时间 前端控制器
 * </p>
 *
 * @author wujin
 * @since 2020-06-30
 */
@RestController
@RequestMapping("/zp/commsup")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ZpCommSupController extends BaseController{
	
	private final IZpCommSupService commSupService;

	/**
	 * 评论点赞点赞
	 * @param id 评论ID
	 * @return
	 */
	@PostMapping("/praise/{id}")
	public Result<Object> praise(@PathVariable Long id){
		return Result.success(commSupService.praise(id));
	}
	
	/**
	 * 取消评论点赞
	 * @param id 评论ID
	 * @return
	 */
	@PostMapping("/unpraise/{id}")
	public Result<Object> unpraise(@PathVariable Long id){
		return Result.success(commSupService.unpraise(id));
	}
	
}
